import request from '@/utils/request'
import type { CategoryList } from './model/categoryModel'

enum Api {
  // 获取品牌属性1-3级分类api
  getCategory1ListApi = '/admin/product/getCategory1',
  getCategory2ListApi = '/admin/product/getCategory2',
  getCategory3ListApi = '/admin/product/getCategory3',
}

export const reqGetCategory1ListData = () => {
  return request.get<any, CategoryList>(Api.getCategory1ListApi)
}
export const reqGetCategory2ListData = (category1Id: number) => {
  return request.get<any, CategoryList>(
    `${Api.getCategory2ListApi}/${category1Id}`
  )
}
export const reqGetCategory3ListData = (category2Id: number) => {
  return request.get<any, CategoryList>(
    `${Api.getCategory3ListApi}/${category2Id}`
  )
}
